package com.project.myPackage;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Slf4j
@SpringBootApplication
// 开启注解扫描 扫描过滤器 才会扫描webFilter注解
@ServletComponentScan
// 开启事务管理
@EnableTransactionManagement
public class MyApplication {

    @Value("${server.port}")
    private int port;
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(MyApplication.class, args);
        MyApplication app = context.getBean(MyApplication.class);
        log.info("项目启动成功...");
        log.info("后端地址：http://localhost:{}", app.port);
        log.info("swagger地址：http://localhost:{}/doc.html",app.port);
    }
}
